The present invention is generally related to graphical image manipulation systems, and more particularly to a system and apparatus for compositing multiple graphical images.
A graphical image manipulation computer program, such as Adobe Photoshop 4.0, from Adobe Systems Incorporated, of San Jose, Calif., may store a graphical image as a set of image layers. Such a program builds a final image by compositing the image layers together. The image layers may be thought of as stacked sheets of acetate. The density of the ink on the acetate controls the transparency of the sheet, i.e., the extent to which the sheet obscures the underlying sheets. In the computer program, the color and density of the ink on the acetate sheet are represented by a color value and an opacity (or “alpha”) value, respectively.
Referring to FIG. 1, a conventional graphical image document 10 includes a set of image layers 12, denoted as layers 1, 2, . . . , n, organized in a layer stack. The bottom layer, i.e., layer 1, acts as the background or bottom sheet, whereas the other layers, i.e., layers 2, 3, . . . , n, act as the transparencies which are overlaid on the background.
Referring to FIG. 2, each image layer 12 typically includes an image 14, an optional mask or masks 16, and compositing controls 18. Typically, the image 14 is represented by an array of pixels, with each pixel having a color and, optionally, an opacity. Similarly, the mask 16 is typically represented by an array of pixels, with each pixel having an opacity. However, the image 14 and the mask 16 could be defined analytically, e.g., by using shape outlines, or by other functions which define color and/or opacity as a function of position. In addition, the image 14 and the mask 16 can be dynamic, i.e., computed at the time the layers are composited from the results of compositing the underlying layers or other data. For example, one layer in the document could be a filter or an adjustment layer in which the data representing the image is determined from the data in an underlying image layer or determined from the composition of the underlying image layers.
The compositing controls 18 may include a global opacity 18a and a transfer mode 18b. The global opacity 18a controls, in essence, the transparency of the entire image layer 12, whereas the transfer mode determines how the colors in the image layer 12 mix with the colors accumulated from the underlying layers. The compositing controls may also be considered to include dynamic masks.
The process of stacking the acetate sheets to form the final image is modeled by an accumulation buffer which stores a composited color for each pixel. The image layers are composited in order from bottom to top. Referring to FIG. 3, a conventional process 20 for compositing an image layer begins by calculating any dynamic data in the image layer, such as the color of the pixels in the image or the opacity of the pixels in the mask (step 22). Then the opacity of each pixel is determined from the mask 16, the global opacity 18a, and, if appropriate, the image 14 (step 24). Finally, the color of each pixel in the image layer is combined with the composited color of the corresponding pixel in the accumulation buffer to generate a new composited color (step 26). The combination is controlled by the opacity of the layer pixel and the transfer mode 18b. This process is iterated for each layer until all the layers have been composited, thus generating the final image.
There are a variety of situations in which a user may wish to group individual layers together and work with the group as a single entity. For example, the user may wish to apply an effect to a group of layers to generate the visual appearance that the group is actually a single layer. Adobe Photoshop 3.0 introduced one such grouping mechanism, called a “clipping group”. In a conventional clipping group, all of the layers in the clipping group are influenced by the mask and transfer mode of the base layer in the group. Unfortunately, in some instances, the image generated by a graphical document that includes a clipping group includes image defects or does not correspond to the desired image. Specifically, some transfer mode effects, such as highlighting and shadowing, may be lost or altered unacceptably in some portions of the image.